package project.dade.cn.bst.adapter.base;

import android.graphics.Paint;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.bingoogolapple.androidcommon.adapter.BGARecyclerViewAdapter;
import cn.bingoogolapple.androidcommon.adapter.BGAViewHolderHelper;
import project.dade.cn.bst.R;
import project.dade.cn.bst.model.IndexInfoHots;

/**
 * Created by vain zhou on 2016/3/9.
 */
public class Goshopingadapter extends BGARecyclerViewAdapter<IndexInfoHots> {

    public Goshopingadapter(RecyclerView recyclerView) {
        super(recyclerView, R.layout.adapter_goshopping);
    }


    @Override
    protected void fillData(BGAViewHolderHelper viewHolderHelper, int position, IndexInfoHots model) {
        ImageView avatorIv =viewHolderHelper.getView(R.id.photo);
        Glide.with(mContext).load(model.getProductImage()).placeholder(R.drawable.image_loader_small).error(R.drawable.image_loader_small).into(avatorIv);
        viewHolderHelper.setText(R.id.title, model.getProductName());
        viewHolderHelper.setText(R.id.sell,model.getMarketPrice());
        viewHolderHelper.setText(R.id.market,model.getMarketPrice());
        viewHolderHelper.getTextView(R.id.market).getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);

    }

}
